home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / bbs / mhis020.zip / FLOAT.MH < prev    next >
Text File  |  1996-09-17  |  490b  |  26 lines

  1. #ifndef __FLOAT_MH
  2. #define __FLOAT_MH
  3.  
  4. string division_result (long: value, long: fact, int: dig) {
  5.   int: d1, temp, counter;
  6.  
  7.   if (fact = 0) {
  8.     return "n.a.";
  9.     };
  10.  
  11.   temp := 1;
  12.   for (counter := 0; counter < dig; counter := counter + 1) {
  13.     temp := temp * 10;
  14.     };
  15.  
  16.   d1 := value % fact * temp / fact;
  17.  
  18.   if (d1 > 0) {
  19.     return ltostr (value / fact) + "." + strpadleft (itostr (d1), dig, '0');
  20.     }
  21.   else return ltostr (value / fact);
  22.   }
  23.  
  24.  
  25. #endif
  26.